var cgsaddress = 'http://localhost/Nga/CyberGatekeeper/Server/';
function auditlogin() {
	$.ajax(
        {
			'url'      : cgsaddress+'getrfad.php?OS=iOS',
			'type'     : 'GET',
			'dataType' : 'xml',
			'success'  : function(data){
				//alert('ok'); console.log(data); 
				$.ajax(
					{
						'url'      : cgsaddress+'putadr.php',
						'type'     : 'POST',
						'dataType' : 'xml',
						'data':escape('<?xml version="1.0" standalone="yes"?><Sections checksum="0"><ADRS><ADR name="SerialNumber" value="093340800072759"/><ADR name="CGAgentType" value="IOSAGENT"/><ADR name="CGAPlatform" value="iOS32"/><ADR name="AgentVer" value="8.1.11157"/><ADR name="CGAVersion" value="v8.1"/><ADR name="ContextID" value="2FE079FA4BCD325A79A5281A2D619EBF"/><ADR name="OS" value="iPhone OS"/></ADRS><Capable><AutoReaudit value="Y"/></Capable></Sections>'),
						//'data':{'param':'value'},
						'contentType': 'text/xml',
						'processData' : false,
						'success'  : function(data){
							//alert('ok'); console.log(data); 
							console.log(data); 
						},
						'error'    : function(){
							alert('Post audit data failed. Please view console log for error detail.');
						},
					}
				);
			},
			'error'    : function(){
				$('.auditicon').attr('src','style/images/auditfail.png');
				$('#info').html('50.0.150.21<br/>Failed.');
				alert('Get audit request failed. Please view console log for error detail.');
			},
        }
    );
}